package com.nbjtjc.safe.api.safe;

import com.nbjtjc.safe.bean.Result;
import com.nbjtjc.safe.model.safe.RiskPointItem;
import com.nbjtjc.safe.service.safe.RiskPointItemServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/safe/riskPointItem")
@CrossOrigin("*")
public class RiskPointItemController {

    @Autowired
    private RiskPointItemServiceImpl riskPointItemService;

    @PostMapping("add")
    public Result add(@RequestBody RiskPointItem riskPointItem){
        return riskPointItemService.add(riskPointItem);
    }
    @PostMapping("addBatch")
    public Result addBatch(@RequestBody List<RiskPointItem> riskPointItems){
        return riskPointItemService.addBatch(riskPointItems);
    }
    @PostMapping("saveBatch")
    public Result saveBatch(@RequestBody List<RiskPointItem> riskPointItems){
        return riskPointItemService.saveBatchNeedUpdate(riskPointItems);
    }
    @PostMapping("delete")
    public Result delete(@RequestBody  RiskPointItem riskPointItem){
        return riskPointItemService.delete(riskPointItem);
    }

    @PostMapping("update")
    public Result update(@RequestBody  RiskPointItem riskPointItem){
        return riskPointItemService.update(riskPointItem);
    }

    @PostMapping("find")
    public Result find(@RequestBody  RiskPointItem riskPointItem){
        return riskPointItemService.find(riskPointItem);
    }
}
